<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" 
           %><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"
           %><%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"
           %><%@ taglib tagdir="/WEB-INF/tags" prefix="cohesion"
           %>
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
<%@ page contentType="text/html;charset=ISO-8859-1"
         %><html:html>
    <head>
        <title>Tareas</title>
        <html:base/>
        <%@include file="../header/include.jsp" %>
    </head>
    <body>
        <div id="header"  class="ui-widget-header ui-corner-all">
            <h1><bean:message key="all.title"/></h1>
            <div id="menu">
                <%--
                <ul id="nav">
                    <li><html:link action="/APreCrearTarea.do"><bean:message key="VTareas.label0"/> Crear Tarea </html:link></li>
                    <li><html:link action="/APreHome.do"><bean:message key="VTareas.label1"/> Volver </html:link></li>

                </ul>--%>
            </div>
        </div>
        <div id="body_wrapper">
            <div id="body">
                <div id="split">
                    <div class="top"></div>
                    <div id="left">
                        <div id="content">
                            ${empty msg ? "" : msg}
                            <div class="fg-toolbar ui-widget-header ui-corner-top">

                                <h1>Tareas</h1>
                            </div>
                            <div  class="ui-widget-content ui-widget">
                                <div style="float: right;margin: 1% 1% 1% 1%; clear: left;">
                                    <ul class="sf_admin_td_actions fg-buttonset fg-buttonset-single">
                                        <cohesion:actor actors="5"><li class="sf_admin_action_usuario"><html:link action="/APreCrearTarea.do" styleClass="fg-button-mini fg-button ui-state-default fg-button-icon-left"><span class="ui-icon ui-icon-plus"></span>Nueva Tarea</html:link></li></cohesion:actor>
                                    </ul>
                                </div>

                                <div class="list ui-grid-table ui-widget ui-corner-all ui-helper-reset ui-helper-clearfix">

                                    <%-- <table border="1">
                                         <thead>
                                             <tr>
                                                 <th>Tarea</th>
                                                 <th>Asunto</th>
                                                 <th>Cuenta</th>
                                                 <th>Contacto</th>
                                                 <th>Prioridad</th>
                                                 <th>Estado</th>
                                             </tr>
                                         </thead>
                                         <tbody><% request.setAttribute("_vacio", new Object[0]);%>
                                             <logic:iterate id="tarea" collection="${empty L_Tarea ? _vacio : L_Tarea}">${tarea.asunto}
                                                 <tr>
                                                     <td><html:link action="/APreTarea.do" paramId="idTarea" paramName="tarea" paramProperty="idTarea">${empty tarea.asunto? edit : tarea.asunto}</html:link></td>
                                                     <td>${tarea.cuentaRelacionada.nombre}</td>
                                                     <td>${tarea.contactoRelacionado.nombre}</td>
                                                     <td>${tarea.prioridad.nombre}</td>
                                                     <td>${tarea.estado.nombre}</td>
                                                 </tr>
                                             </logic:iterate>
                                         </tbody>
                                     </table>--%>


                                    <display:table name="L_Tarea" requestURI="/APreTareas.do" pagesize="10"  class="display-tag-tarea" htmlId="display-tag-tarea" id="tarea">
                                        <display:column property="asunto" title="Asunto" sortable="true"/>
                                        <display:column property="cuentaRelacionada.nombre" title="Cuenta Relacionada" sortable="true"/>
                                        <display:column property="contactoRelacionado.nombre" title="Contacto Relacionado" sortable="true" />
                                        <display:column property="prioridad.nombre" title="Prioridad" sortable="true" />
                                        <display:column property="estado.nombre" title="Estado" sortable="true" />
                                        <display:column title="Acciones">

                                            <ul class="sf_admin_td_actions fg-buttonset fg-buttonset-single">
                                                <li class="sf_admin_action_show"><html:link action="/APreTarea.do" paramId="idTarea" paramName="tarea" paramProperty="idTarea" styleClass="fg-button-mini fg-button ui-state-default fg-button-icon-left"><span class="ui-icon ui-icon-document"></span>Mostrar</html:link></li>
                                                <li class="sf_admin_action_edit"><html:link action="/APreEditarTarea.do" paramId="idTarea" paramName="tarea" paramProperty="idTarea" styleClass="fg-button-mini fg-button ui-state-default fg-button-icon-left"><span class="ui-icon ui-icon-pencil"></span>Editar</html:link>
                                                <li class="sf_admin_action_delete"><html:link action="/AEliminarTarea" paramId="idTarea" paramName="tarea" paramProperty="idTarea" styleClass="fg-button-mini fg-button ui-state-default fg-button-icon-left"><span class="ui-icon ui-icon-trash"></span>Borrar</html:link>
                                            </ul>

                                        </display:column>

                                    </display:table>

                                    <script>
                                        $(document).ready(function() {

                                            $('table#display-tag-tarea thead').addClass('ui-widget-header');
                                            $('table#display-tag-tarea thead tr th').addClass('ui-state-default ui-th-column');
                                            $('table#display-tag-tarea tbody tr').addClass('sf_admin_row ui-widget-content odd');



                                        });
                                    </script>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="right">

                        <%@include file="../administrador/VMenuAdmin.jsp" %>



                    </div>

                    <div class="clearer ui-helper-clearfix"></div>
                    <div class="bottom"></div>
                </div>
                <div class="clearer"></div>
            </div>
            <div class="clearer"></div>
        </div>
        <div id="end_body"></div>
<div id="footer"> <%@include file="/footer/include.jsp" %> </div>

    </body>
</html:html>